<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->

<title>newpad</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<xref type="10" name="newpad"></xref>
<h4><a name = "tag_001_009_736">&nbsp;</a>NAME</h4><blockquote>
newpad, pnoutrefresh, prefresh, subpad - pad management functions
</blockquote><h4><a name = "tag_001_009_737">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="curses.h.html">curses.h</a>&gt;

WINDOW *newpad(int <i>nlines</i>, int <i>ncols</i>);

int pnoutrefresh(WINDOW *<i>pad</i>, int <i>pminrow</i>, int <i>pmincol</i>, int <i>sminrow</i>,
                 int <i>smincol</i>, int <i>smaxrow</i>, int <i>smaxcol</i>);

int prefresh(WINDOW *<i>pad</i>, int <i>pminrow</i>, int <i>pmincol</i>, int <i>sminrow</i>,
             int <i>smincol</i>, int <i>smaxrow</i>, int <i>smaxcol</i>);

WINDOW *subpad(WINDOW *<i>orig</i>, int <i>nlines</i>, int <i>ncols</i>, int <i>begin_y</i>,
               int <i>begin_x</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_001_009_738">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>newpad()</i>
function creates a specialised <b>WINDOW</b> data structure representing a pad
with <i>nlines</i> lines and <i>ncols</i> columns.  A pad is like a window,
except that it is not necessarily associated with a viewable part of the
screen.  Automatic refreshes of pads do not occur.
<p>
The
<i><a href="subpad.html">subpad()</a></i>
function creates a subwindow within a pad with <i>nlines</i> lines and
<i>ncols</i> columns.  Unlike
<i><a href="subwin.html">subwin()</a></i>,
which uses screen coordinates, the window is at position (<i>begin_y</i>,
<i>begin_x</i>) on the pad.  The window is made in the middle of the window
<i>orig</i>, so that changes made to one window affect both windows.
<p>
The
<i>prefresh()</i>
and
<i><a href="pnoutrefresh.html">pnoutrefresh()</a></i>
functions are analogous to
<i><a href="wrefresh.html">wrefresh()</a></i>
and
<i><a href="wnoutrefresh.html">wnoutrefresh()</a></i>
except that they relate to pads instead of windows.  The additional arguments
indicate what part of the pad and screen are involved.
The <i>pminrow</i> and <i>pmincol</i> arguments specify the origin of the
rectangle to be displayed in the pad.  The <i>sminrow</i>, <i>smincol</i>,
<i>smaxrow</i> and <i>smaxcol</i> arguments
specify the edges of the rectangle to be
displayed on the screen.  The lower right-hand corner of the rectangle to be
displayed in the pad is calculated from the screen coordinates, since the
rectangles must be the same size.  Both rectangles must be entirely contained
within their respective structures.  Negative values of <i>pminrow</i>,
<i>pmincol</i>, <i>sminrow</i> or <i>smincol</i> are treated as if they were
zero.
</blockquote><h4><a name = "tag_001_009_739">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion, the
<i>newpad()</i>
&nbsp;and
<i><a href="subpad.html">subpad()</a></i>
&nbsp;functions return a pointer to the pad data structure.  Otherwise, they return
a null pointer.
<p>
Upon successful completion,
<i><a href="pnoutrefresh.html">pnoutrefresh()</a></i>
and
<i>prefresh()</i>
return OK.  Otherwise, they return ERR.
</blockquote><h4><a name = "tag_001_009_740">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_001_009_741">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
To refresh a pad, call
<i>prefresh()</i>
or
<i><a href="pnoutrefresh.html">pnoutrefresh()</a></i>,
not
<i><a href="wrefresh.html">wrefresh()</a></i>.
When porting code to use pads from WINDOWS, remember that these functions
require additional arguments to specify the part of the pad to be displayed
and the location on the screen to be used for the display.
<p>
Although a subwindow and its parent pad may share memory representing
characters in the pad, they need not share status information about what has
changed in the pad.  Therefore, after modifying a subwindow within a pad, it
may be necessary to call
<i><a href="touchwin.html">touchwin()</a></i>
or
<i><a href="touchline.html">touchline()</a></i>
on the pad before calling
<i>prefresh()</i>.
</blockquote><h4><a name = "tag_001_009_742">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="derwin.html">derwin()</a></i>,
<i><a href="doupdate.html">doupdate()</a></i>,
<i><a href="is_linetouched.html">is_linetouched()</a></i>,
<i><a href="curses.h.html">&lt;curses.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
